<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<?php
$attributes = array(
    'class' => 'control-label',
);
?>

<div class="span9">
    <?php $causa = $this->session->userdata('causa'); ?>
    <div class="breadcrumb">
        <h4 style="margin: 0px;"><?php echo $causa['caratula'] . ' - ' . $causa['nroExpediente']; ?></h4>
    </div>

    <?php echo get_message(); ?>
    <h2><?php echo $titulo; ?></h2>

    <?php echo form_open(); ?>

    <div class="row-fluid">
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Tomo', 'tomo', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'tomo', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Folio', 'folio', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'folio', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Depto Judicial', 'deptoJudicial', $attributes); ?>
                <div class="controls">
                    <?php echo form_dropdown('deptoJudicial', $deptos_judiciales, '', 'class="span11" id="deptoJudicial"'); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Nombre', 'nombre', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'nombre', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="control-group">
                <?php echo form_label('Apellido', 'apellido', $attributes); ?>
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'apellido', 'type' => 'text')); ?>
                </div>
            </div>
        </div>
        <div class="span2">
            <div class="clearfix" style="height: 25px;"></div>
            <div class="control-group">
                <div class="controls">
                    <?php echo form_input(array('class' => 'span11', 'name' => 'submit', 'type' => 'submit', 'value' => 'Buscar', 'class' => 'btn')); ?>
                </div>
            </div>
        </div>
    </div>

    <?php echo form_close(); ?>

    <?php if (!empty($abogados_demandantes)) { ?>

        <div class="container-table">
            <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-hover table-bordered">
                <thead>
                    <tr>
                        <th>Tomo</th>
                        <th>Folio</th>
                        <th>Depto Judicial</th>
                        <th>Nombre</th>
                        <th>Apellido</th>
                        <th>Acciones</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $color = 'odd';
                    foreach ($abogados_demandantes as $abogado_demandante) {
                        if (!in_array($abogado_demandante->id, $abogados_demandantes_agregados)) {
                            $color = ( $color == 'odd') ? 'even' : 'odd';
                            ?>

                            <tr class="<?php echo $color; ?>">
                                <td><?php echo $abogado_demandante->tomo; ?></td>
                                <td><?php echo $abogado_demandante->folio; ?></td>
                                <td><?php echo $deptos_judiciales[$abogado_demandante->deptoJudicial]; ?></td>
                                <td><?php echo $abogado_demandante->nombre; ?></td>
                                <td><?php echo $abogado_demandante->apellido; ?></td>
                                <td>
                                    <a class="btn btn-small" href="<?php echo base_url('causas/intervinientes/nuevo_abogado_demandante/' . $abogado_demandante->id); ?>"><span class="icon-plus-sign"></span> Agregar</a>
                                </td>
                            </tr>
                            <?php
                        }
                    }
                    ?>
                </tbody>
            </table>
        <?php } ?>

        <div class="clearfix"></div>

        <a href="<?php echo base_url('causas/intervinientes/nuevo_abogado_demandante/') ?>"><i class="icon-plus-sign"></i> Agregar Nuevo</a>
    </div>
</div>

<?php echo form_hidden('url', ''); ?>